#include "Unary.h"

#include <assert.h>

Unary::Unary(Expr *_expr, Token *_tok)
    :subExpr(_expr), Expr(_tok)
{
    type = subExpr->Type();
    assert(token->Tag() == '-');
}


Unary::~Unary(void)
{
    delete subExpr;
}

int Unary::DoEvalInt()
{
    return -subExpr->EvalInt();
}

float Unary::DoEvalFlt()
{
    return -subExpr->EvalFlt();
}
